{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "586fa886",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "import random\n",
    "from datetime import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "00b507bb",
   "metadata": {},
   "outputs": [],
   "source": [
    "alz = pd.read_csv('Fight Alzheimer.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "04df7e89",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Summary</th>\n",
       "      <th>Issue id</th>\n",
       "      <th>Status</th>\n",
       "      <th>Resolution</th>\n",
       "      <th>Assignee</th>\n",
       "      <th>Updated</th>\n",
       "      <th>Resolved</th>\n",
       "      <th>Due date</th>\n",
       "      <th>Original estimate</th>\n",
       "      <th>Time Spent</th>\n",
       "      <th>Custom field (Start date)</th>\n",
       "      <th>Dependency</th>\n",
       "      <th>Label(Binary) Project with all tasks</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Project Proposal</td>\n",
       "      <td>10000</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>2/28/2022 13:42</td>\n",
       "      <td>2/12/2022</td>\n",
       "      <td>2/17/2022</td>\n",
       "      <td>24 hours</td>\n",
       "      <td>18 hours</td>\n",
       "      <td>2/9/2022 0:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SRS document</td>\n",
       "      <td>10001</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2/27/2022</td>\n",
       "      <td>36 hours</td>\n",
       "      <td>14 hours</td>\n",
       "      <td>2/14/2022 0:00</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SDS document</td>\n",
       "      <td>10002</td>\n",
       "      <td>In Progress</td>\n",
       "      <td>To Do</td>\n",
       "      <td>Violet</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3/31/2022</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>3/16/2022 0:00</td>\n",
       "      <td>10001.0</td>\n",
       "      <td>good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Use case diagrams</td>\n",
       "      <td>10003</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4/5/2022</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>5 hours</td>\n",
       "      <td>3/20/2022 0:00</td>\n",
       "      <td>10002.0</td>\n",
       "      <td>good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Sequence Diagrams</td>\n",
       "      <td>10004</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4/14/2022</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>3/18/2022 0:00</td>\n",
       "      <td>10003.0</td>\n",
       "      <td>bad</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Summary  Issue id       Status Resolution   Assignee  \\\n",
       "0   Project Proposal     10000         Done       Done  Alexandra   \n",
       "1       SRS document     10001         Done       Done      Angie   \n",
       "2       SDS document     10002  In Progress      To Do     Violet   \n",
       "3  Use case diagrams     10003         Done       Done  Alexandra   \n",
       "4  Sequence Diagrams     10004         Done       Done      Angie   \n",
       "\n",
       "           Updated   Resolved   Due date Original estimate Time Spent  \\\n",
       "0  2/28/2022 13:42  2/12/2022  2/17/2022          24 hours   18 hours   \n",
       "1  2/28/2022 12:02        NaN  2/27/2022          36 hours   14 hours   \n",
       "2  2/28/2022 12:02        NaN  3/31/2022          12 hours    8 hours   \n",
       "3              NaN        NaN   4/5/2022           8 hours    5 hours   \n",
       "4  2/28/2022 12:01        NaN  4/14/2022           8 hours   12 hours   \n",
       "\n",
       "  Custom field (Start date)  Dependency Label(Binary) Project with all tasks  \n",
       "0             2/9/2022 0:00         NaN                                 good  \n",
       "1            2/14/2022 0:00     10000.0                                 good  \n",
       "2            3/16/2022 0:00     10001.0                                 good  \n",
       "3            3/20/2022 0:00     10002.0                                 good  \n",
       "4            3/18/2022 0:00     10003.0                                  bad  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alz.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "2ca240f1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Summary                                  object\n",
       "Issue id                                  int64\n",
       "Status                                   object\n",
       "Resolution                               object\n",
       "Assignee                                 object\n",
       "Updated                                  object\n",
       "Resolved                                 object\n",
       "Due date                                 object\n",
       "Original estimate                        object\n",
       "Time Spent                               object\n",
       "Custom field (Start date)                object\n",
       "Dependency                              float64\n",
       "Label(Binary) Project with all tasks     object\n",
       "dtype: object"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alz.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "777be7fd",
   "metadata": {},
   "outputs": [],
   "source": [
    "alz['Due date'] = alz['Due date'].apply(pd.to_datetime, errors = 'coerce')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2cf177ca",
   "metadata": {},
   "source": [
    "# when importing a csv file it will be a copy. Based on the action, we would have to manually run it again\n",
    "every time we append the row, we have to rerun the row. This should be a classification algorithm. When user action happens, then we should rerender. When the algorithm is created, we should make sure the algorithm is constantly checking how many rows and columns. If x axis is the same, the we could rerun, if the x axis has a new or deleted number, the we update. If y is updated, then we can compare in a loop. Same column numbers, but different types. Codyacademy.com\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "808d7817",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Summary                                         object\n",
       "Issue id                                         int64\n",
       "Status                                          object\n",
       "Resolution                                      object\n",
       "Assignee                                        object\n",
       "Updated                                         object\n",
       "Resolved                                        object\n",
       "Due date                                datetime64[ns]\n",
       "Original estimate                               object\n",
       "Time Spent                                      object\n",
       "Custom field (Start date)                       object\n",
       "Dependency                                     float64\n",
       "Label(Binary) Project with all tasks            object\n",
       "dtype: object"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alz.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "f3ee3ef2",
   "metadata": {},
   "outputs": [],
   "source": [
    "alz['Custom field (Start date)'] = alz['Custom field (Start date)'].apply(pd.to_datetime, errors = 'coerce')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "68c3afe1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Summary                                         object\n",
       "Issue id                                         int64\n",
       "Status                                          object\n",
       "Resolution                                      object\n",
       "Assignee                                        object\n",
       "Updated                                         object\n",
       "Resolved                                        object\n",
       "Due date                                datetime64[ns]\n",
       "Original estimate                               object\n",
       "Time Spent                                      object\n",
       "Custom field (Start date)               datetime64[ns]\n",
       "Dependency                                     float64\n",
       "Label(Binary) Project with all tasks            object\n",
       "dtype: object"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alz.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "6ccba80c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Summary</th>\n",
       "      <th>Issue id</th>\n",
       "      <th>Status</th>\n",
       "      <th>Resolution</th>\n",
       "      <th>Assignee</th>\n",
       "      <th>Updated</th>\n",
       "      <th>Resolved</th>\n",
       "      <th>Due date</th>\n",
       "      <th>Original estimate</th>\n",
       "      <th>Time Spent</th>\n",
       "      <th>Custom field (Start date)</th>\n",
       "      <th>Dependency</th>\n",
       "      <th>Label(Binary) Project with all tasks</th>\n",
       "      <th>diff_dates</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Project Proposal</td>\n",
       "      <td>10000</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>2/28/2022 13:42</td>\n",
       "      <td>2/12/2022</td>\n",
       "      <td>2022-02-17</td>\n",
       "      <td>24 hours</td>\n",
       "      <td>18 hours</td>\n",
       "      <td>2022-02-09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>good</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SRS document</td>\n",
       "      <td>10001</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-02-27</td>\n",
       "      <td>36 hours</td>\n",
       "      <td>14 hours</td>\n",
       "      <td>2022-02-14</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>good</td>\n",
       "      <td>13.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SDS document</td>\n",
       "      <td>10002</td>\n",
       "      <td>In Progress</td>\n",
       "      <td>To Do</td>\n",
       "      <td>Violet</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-03-31</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>2022-03-16</td>\n",
       "      <td>10001.0</td>\n",
       "      <td>good</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Use case diagrams</td>\n",
       "      <td>10003</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-04-05</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>5 hours</td>\n",
       "      <td>2022-03-20</td>\n",
       "      <td>10002.0</td>\n",
       "      <td>good</td>\n",
       "      <td>16.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Sequence Diagrams</td>\n",
       "      <td>10004</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-04-14</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>2022-03-18</td>\n",
       "      <td>10003.0</td>\n",
       "      <td>bad</td>\n",
       "      <td>27.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Summary  Issue id       Status Resolution   Assignee  \\\n",
       "0   Project Proposal     10000         Done       Done  Alexandra   \n",
       "1       SRS document     10001         Done       Done      Angie   \n",
       "2       SDS document     10002  In Progress      To Do     Violet   \n",
       "3  Use case diagrams     10003         Done       Done  Alexandra   \n",
       "4  Sequence Diagrams     10004         Done       Done      Angie   \n",
       "\n",
       "           Updated   Resolved   Due date Original estimate Time Spent  \\\n",
       "0  2/28/2022 13:42  2/12/2022 2022-02-17          24 hours   18 hours   \n",
       "1  2/28/2022 12:02        NaN 2022-02-27          36 hours   14 hours   \n",
       "2  2/28/2022 12:02        NaN 2022-03-31          12 hours    8 hours   \n",
       "3              NaN        NaN 2022-04-05           8 hours    5 hours   \n",
       "4  2/28/2022 12:01        NaN 2022-04-14           8 hours   12 hours   \n",
       "\n",
       "  Custom field (Start date)  Dependency Label(Binary) Project with all tasks  \\\n",
       "0                2022-02-09         NaN                                 good   \n",
       "1                2022-02-14     10000.0                                 good   \n",
       "2                2022-03-16     10001.0                                 good   \n",
       "3                2022-03-20     10002.0                                 good   \n",
       "4                2022-03-18     10003.0                                  bad   \n",
       "\n",
       "   diff_dates  \n",
       "0         8.0  \n",
       "1        13.0  \n",
       "2        15.0  \n",
       "3        16.0  \n",
       "4        27.0  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alz['diff_dates'] = alz['Due date'] - alz['Custom field (Start date)']\n",
    "alz['diff_dates'] = alz['diff_dates']/np.timedelta64(1,'D')\n",
    "alz.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "eaa195d0",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "percent_random = random.uniform(0, 1)\n",
    "if (random.uniform(0,1) > .5): \n",
    "        percent_sign = 1 \n",
    "else:\n",
    "    percent_sign =  -1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "59b07c04",
   "metadata": {},
   "outputs": [],
   "source": [
    "percentage = percent_sign * percent_random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "537bdcc7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Summary</th>\n",
       "      <th>Issue id</th>\n",
       "      <th>Status</th>\n",
       "      <th>Resolution</th>\n",
       "      <th>Assignee</th>\n",
       "      <th>Updated</th>\n",
       "      <th>Resolved</th>\n",
       "      <th>Due date</th>\n",
       "      <th>Original estimate</th>\n",
       "      <th>Time Spent</th>\n",
       "      <th>Custom field (Start date)</th>\n",
       "      <th>Dependency</th>\n",
       "      <th>Label(Binary) Project with all tasks</th>\n",
       "      <th>diff_dates</th>\n",
       "      <th>Transform_to_diff_date</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Project Proposal</td>\n",
       "      <td>10000</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>2/28/2022 13:42</td>\n",
       "      <td>2/12/2022</td>\n",
       "      <td>2022-02-17</td>\n",
       "      <td>24 hours</td>\n",
       "      <td>18 hours</td>\n",
       "      <td>2022-02-09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>good</td>\n",
       "      <td>8.0</td>\n",
       "      <td>8.232708</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SRS document</td>\n",
       "      <td>10001</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-02-27</td>\n",
       "      <td>36 hours</td>\n",
       "      <td>14 hours</td>\n",
       "      <td>2022-02-14</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>good</td>\n",
       "      <td>13.0</td>\n",
       "      <td>13.378151</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SDS document</td>\n",
       "      <td>10002</td>\n",
       "      <td>In Progress</td>\n",
       "      <td>To Do</td>\n",
       "      <td>Violet</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-03-31</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>2022-03-16</td>\n",
       "      <td>10001.0</td>\n",
       "      <td>good</td>\n",
       "      <td>15.0</td>\n",
       "      <td>15.436328</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Use case diagrams</td>\n",
       "      <td>10003</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-04-05</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>5 hours</td>\n",
       "      <td>2022-03-20</td>\n",
       "      <td>10002.0</td>\n",
       "      <td>good</td>\n",
       "      <td>16.0</td>\n",
       "      <td>16.465416</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Sequence Diagrams</td>\n",
       "      <td>10004</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-04-14</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>2022-03-18</td>\n",
       "      <td>10003.0</td>\n",
       "      <td>bad</td>\n",
       "      <td>27.0</td>\n",
       "      <td>27.785390</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Summary  Issue id       Status Resolution   Assignee  \\\n",
       "0   Project Proposal     10000         Done       Done  Alexandra   \n",
       "1       SRS document     10001         Done       Done      Angie   \n",
       "2       SDS document     10002  In Progress      To Do     Violet   \n",
       "3  Use case diagrams     10003         Done       Done  Alexandra   \n",
       "4  Sequence Diagrams     10004         Done       Done      Angie   \n",
       "\n",
       "           Updated   Resolved   Due date Original estimate Time Spent  \\\n",
       "0  2/28/2022 13:42  2/12/2022 2022-02-17          24 hours   18 hours   \n",
       "1  2/28/2022 12:02        NaN 2022-02-27          36 hours   14 hours   \n",
       "2  2/28/2022 12:02        NaN 2022-03-31          12 hours    8 hours   \n",
       "3              NaN        NaN 2022-04-05           8 hours    5 hours   \n",
       "4  2/28/2022 12:01        NaN 2022-04-14           8 hours   12 hours   \n",
       "\n",
       "  Custom field (Start date)  Dependency Label(Binary) Project with all tasks  \\\n",
       "0                2022-02-09         NaN                                 good   \n",
       "1                2022-02-14     10000.0                                 good   \n",
       "2                2022-03-16     10001.0                                 good   \n",
       "3                2022-03-20     10002.0                                 good   \n",
       "4                2022-03-18     10003.0                                  bad   \n",
       "\n",
       "   diff_dates  Transform_to_diff_date  \n",
       "0         8.0                8.232708  \n",
       "1        13.0               13.378151  \n",
       "2        15.0               15.436328  \n",
       "3        16.0               16.465416  \n",
       "4        27.0               27.785390  "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alz['Transform_to_diff_date'] = alz['diff_dates'] * ( 1 + percentage )\n",
    "alz.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "83b62044",
   "metadata": {},
   "source": [
    "Save results to a file. Wrap all of the work in a loop for 1000\n",
    "we might have to generate a list of randoms, that way every row can have its own random number\n",
    "Call each file a different name, create a folder due_date bad examples\n",
    "Then file name can be a number.\n",
    "\n",
    "Same process with the good data as well"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "e86cda80",
   "metadata": {},
   "outputs": [],
   "source": [
    " alz['Transform_to_diff_date'] = alz['Transform_to_diff_date'].apply(np.ceil)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "eaf1db70",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Summary</th>\n",
       "      <th>Issue id</th>\n",
       "      <th>Status</th>\n",
       "      <th>Resolution</th>\n",
       "      <th>Assignee</th>\n",
       "      <th>Updated</th>\n",
       "      <th>Resolved</th>\n",
       "      <th>Due date</th>\n",
       "      <th>Original estimate</th>\n",
       "      <th>Time Spent</th>\n",
       "      <th>Custom field (Start date)</th>\n",
       "      <th>Dependency</th>\n",
       "      <th>Label(Binary) Project with all tasks</th>\n",
       "      <th>diff_dates</th>\n",
       "      <th>Transform_to_diff_date</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Project Proposal</td>\n",
       "      <td>10000</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>2/28/2022 13:42</td>\n",
       "      <td>2/12/2022</td>\n",
       "      <td>2022-02-17</td>\n",
       "      <td>24 hours</td>\n",
       "      <td>18 hours</td>\n",
       "      <td>2022-02-09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>good</td>\n",
       "      <td>8.0</td>\n",
       "      <td>9.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SRS document</td>\n",
       "      <td>10001</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-02-27</td>\n",
       "      <td>36 hours</td>\n",
       "      <td>14 hours</td>\n",
       "      <td>2022-02-14</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>good</td>\n",
       "      <td>13.0</td>\n",
       "      <td>14.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SDS document</td>\n",
       "      <td>10002</td>\n",
       "      <td>In Progress</td>\n",
       "      <td>To Do</td>\n",
       "      <td>Violet</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-03-31</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>2022-03-16</td>\n",
       "      <td>10001.0</td>\n",
       "      <td>good</td>\n",
       "      <td>15.0</td>\n",
       "      <td>16.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Use case diagrams</td>\n",
       "      <td>10003</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-04-05</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>5 hours</td>\n",
       "      <td>2022-03-20</td>\n",
       "      <td>10002.0</td>\n",
       "      <td>good</td>\n",
       "      <td>16.0</td>\n",
       "      <td>17.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Sequence Diagrams</td>\n",
       "      <td>10004</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-04-14</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>2022-03-18</td>\n",
       "      <td>10003.0</td>\n",
       "      <td>bad</td>\n",
       "      <td>27.0</td>\n",
       "      <td>28.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Summary  Issue id       Status Resolution   Assignee  \\\n",
       "0   Project Proposal     10000         Done       Done  Alexandra   \n",
       "1       SRS document     10001         Done       Done      Angie   \n",
       "2       SDS document     10002  In Progress      To Do     Violet   \n",
       "3  Use case diagrams     10003         Done       Done  Alexandra   \n",
       "4  Sequence Diagrams     10004         Done       Done      Angie   \n",
       "\n",
       "           Updated   Resolved   Due date Original estimate Time Spent  \\\n",
       "0  2/28/2022 13:42  2/12/2022 2022-02-17          24 hours   18 hours   \n",
       "1  2/28/2022 12:02        NaN 2022-02-27          36 hours   14 hours   \n",
       "2  2/28/2022 12:02        NaN 2022-03-31          12 hours    8 hours   \n",
       "3              NaN        NaN 2022-04-05           8 hours    5 hours   \n",
       "4  2/28/2022 12:01        NaN 2022-04-14           8 hours   12 hours   \n",
       "\n",
       "  Custom field (Start date)  Dependency Label(Binary) Project with all tasks  \\\n",
       "0                2022-02-09         NaN                                 good   \n",
       "1                2022-02-14     10000.0                                 good   \n",
       "2                2022-03-16     10001.0                                 good   \n",
       "3                2022-03-20     10002.0                                 good   \n",
       "4                2022-03-18     10003.0                                  bad   \n",
       "\n",
       "   diff_dates  Transform_to_diff_date  \n",
       "0         8.0                     9.0  \n",
       "1        13.0                    14.0  \n",
       "2        15.0                    16.0  \n",
       "3        16.0                    17.0  \n",
       "4        27.0                    28.0  "
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alz.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "5ae49727",
   "metadata": {},
   "outputs": [],
   "source": [
    "#creating random due dates\n",
    "alz['Randomize_due_date'] = alz['Due date'] + pd.to_timedelta(alz['Transform_to_diff_date'], unit = 'd')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "b3da0bbf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Summary</th>\n",
       "      <th>Issue id</th>\n",
       "      <th>Status</th>\n",
       "      <th>Resolution</th>\n",
       "      <th>Assignee</th>\n",
       "      <th>Updated</th>\n",
       "      <th>Resolved</th>\n",
       "      <th>Due date</th>\n",
       "      <th>Original estimate</th>\n",
       "      <th>Time Spent</th>\n",
       "      <th>Custom field (Start date)</th>\n",
       "      <th>Dependency</th>\n",
       "      <th>Label(Binary) Project with all tasks</th>\n",
       "      <th>diff_dates</th>\n",
       "      <th>Transform_to_diff_date</th>\n",
       "      <th>Randomize_due_date</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Project Proposal</td>\n",
       "      <td>10000</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>2/28/2022 13:42</td>\n",
       "      <td>2/12/2022</td>\n",
       "      <td>2022-02-17</td>\n",
       "      <td>24 hours</td>\n",
       "      <td>18 hours</td>\n",
       "      <td>2022-02-09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>good</td>\n",
       "      <td>8.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2022-02-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SRS document</td>\n",
       "      <td>10001</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-02-27</td>\n",
       "      <td>36 hours</td>\n",
       "      <td>14 hours</td>\n",
       "      <td>2022-02-14</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>good</td>\n",
       "      <td>13.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2022-03-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SDS document</td>\n",
       "      <td>10002</td>\n",
       "      <td>In Progress</td>\n",
       "      <td>To Do</td>\n",
       "      <td>Violet</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-03-31</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>2022-03-16</td>\n",
       "      <td>10001.0</td>\n",
       "      <td>good</td>\n",
       "      <td>15.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>2022-04-16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Use case diagrams</td>\n",
       "      <td>10003</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-04-05</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>5 hours</td>\n",
       "      <td>2022-03-20</td>\n",
       "      <td>10002.0</td>\n",
       "      <td>good</td>\n",
       "      <td>16.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>2022-04-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Sequence Diagrams</td>\n",
       "      <td>10004</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2022-04-14</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>2022-03-18</td>\n",
       "      <td>10003.0</td>\n",
       "      <td>bad</td>\n",
       "      <td>27.0</td>\n",
       "      <td>28.0</td>\n",
       "      <td>2022-05-12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Summary  Issue id       Status Resolution   Assignee  \\\n",
       "0   Project Proposal     10000         Done       Done  Alexandra   \n",
       "1       SRS document     10001         Done       Done      Angie   \n",
       "2       SDS document     10002  In Progress      To Do     Violet   \n",
       "3  Use case diagrams     10003         Done       Done  Alexandra   \n",
       "4  Sequence Diagrams     10004         Done       Done      Angie   \n",
       "\n",
       "           Updated   Resolved   Due date Original estimate Time Spent  \\\n",
       "0  2/28/2022 13:42  2/12/2022 2022-02-17          24 hours   18 hours   \n",
       "1  2/28/2022 12:02        NaN 2022-02-27          36 hours   14 hours   \n",
       "2  2/28/2022 12:02        NaN 2022-03-31          12 hours    8 hours   \n",
       "3              NaN        NaN 2022-04-05           8 hours    5 hours   \n",
       "4  2/28/2022 12:01        NaN 2022-04-14           8 hours   12 hours   \n",
       "\n",
       "  Custom field (Start date)  Dependency Label(Binary) Project with all tasks  \\\n",
       "0                2022-02-09         NaN                                 good   \n",
       "1                2022-02-14     10000.0                                 good   \n",
       "2                2022-03-16     10001.0                                 good   \n",
       "3                2022-03-20     10002.0                                 good   \n",
       "4                2022-03-18     10003.0                                  bad   \n",
       "\n",
       "   diff_dates  Transform_to_diff_date Randomize_due_date  \n",
       "0         8.0                     9.0         2022-02-26  \n",
       "1        13.0                    14.0         2022-03-13  \n",
       "2        15.0                    16.0         2022-04-16  \n",
       "3        16.0                    17.0         2022-04-22  \n",
       "4        27.0                    28.0         2022-05-12  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alz.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "c504b1db",
   "metadata": {},
   "outputs": [],
   "source": [
    "# drop the due date\n",
    "alz.drop(columns=['Due date', 'diff_dates','Transform_to_diff_date'], inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "eceedfee",
   "metadata": {},
   "outputs": [],
   "source": [
    "alz['Due_date'] = alz['Randomize_due_date']\n",
    "alz.drop(columns=['Randomize_due_date'], inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "1a99532d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Summary</th>\n",
       "      <th>Issue id</th>\n",
       "      <th>Status</th>\n",
       "      <th>Resolution</th>\n",
       "      <th>Assignee</th>\n",
       "      <th>Updated</th>\n",
       "      <th>Resolved</th>\n",
       "      <th>Original estimate</th>\n",
       "      <th>Time Spent</th>\n",
       "      <th>Custom field (Start date)</th>\n",
       "      <th>Dependency</th>\n",
       "      <th>Label(Binary) Project with all tasks</th>\n",
       "      <th>Due_date</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Project Proposal</td>\n",
       "      <td>10000</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>2/28/2022 13:42</td>\n",
       "      <td>2/12/2022</td>\n",
       "      <td>24 hours</td>\n",
       "      <td>18 hours</td>\n",
       "      <td>2022-02-09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>good</td>\n",
       "      <td>2022-02-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SRS document</td>\n",
       "      <td>10001</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36 hours</td>\n",
       "      <td>14 hours</td>\n",
       "      <td>2022-02-14</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>good</td>\n",
       "      <td>2022-03-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SDS document</td>\n",
       "      <td>10002</td>\n",
       "      <td>In Progress</td>\n",
       "      <td>To Do</td>\n",
       "      <td>Violet</td>\n",
       "      <td>2/28/2022 12:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>2022-03-16</td>\n",
       "      <td>10001.0</td>\n",
       "      <td>good</td>\n",
       "      <td>2022-04-16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Use case diagrams</td>\n",
       "      <td>10003</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Alexandra</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>5 hours</td>\n",
       "      <td>2022-03-20</td>\n",
       "      <td>10002.0</td>\n",
       "      <td>good</td>\n",
       "      <td>2022-04-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Sequence Diagrams</td>\n",
       "      <td>10004</td>\n",
       "      <td>Done</td>\n",
       "      <td>Done</td>\n",
       "      <td>Angie</td>\n",
       "      <td>2/28/2022 12:01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8 hours</td>\n",
       "      <td>12 hours</td>\n",
       "      <td>2022-03-18</td>\n",
       "      <td>10003.0</td>\n",
       "      <td>bad</td>\n",
       "      <td>2022-05-12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Summary  Issue id       Status Resolution   Assignee  \\\n",
       "0   Project Proposal     10000         Done       Done  Alexandra   \n",
       "1       SRS document     10001         Done       Done      Angie   \n",
       "2       SDS document     10002  In Progress      To Do     Violet   \n",
       "3  Use case diagrams     10003         Done       Done  Alexandra   \n",
       "4  Sequence Diagrams     10004         Done       Done      Angie   \n",
       "\n",
       "           Updated   Resolved Original estimate Time Spent  \\\n",
       "0  2/28/2022 13:42  2/12/2022          24 hours   18 hours   \n",
       "1  2/28/2022 12:02        NaN          36 hours   14 hours   \n",
       "2  2/28/2022 12:02        NaN          12 hours    8 hours   \n",
       "3              NaN        NaN           8 hours    5 hours   \n",
       "4  2/28/2022 12:01        NaN           8 hours   12 hours   \n",
       "\n",
       "  Custom field (Start date)  Dependency Label(Binary) Project with all tasks  \\\n",
       "0                2022-02-09         NaN                                 good   \n",
       "1                2022-02-14     10000.0                                 good   \n",
       "2                2022-03-16     10001.0                                 good   \n",
       "3                2022-03-20     10002.0                                 good   \n",
       "4                2022-03-18     10003.0                                  bad   \n",
       "\n",
       "    Due_date  \n",
       "0 2022-02-26  \n",
       "1 2022-03-13  \n",
       "2 2022-04-16  \n",
       "3 2022-04-22  \n",
       "4 2022-05-12  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alz.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "4bb879ca",
   "metadata": {},
   "outputs": [],
   "source": [
    "alz.to_csv('./Due date bad examples/file1.csv', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d748de58",
   "metadata": {},
   "outputs": [],
   "source": [
    "!python honors.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "462025c6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
